public class Print {
    static void print(int n) {
        if(n > 9){
            print(n / 10);
        }
        System.out.print(n % 10+ " ");
    }

    public static void main(String[] args) {
        Print.print(1234);
    }
}
